<script setup>
import { ref, computed, defineProps, defineEmits } from "vue";
import { Folder, Edit, Document } from '@element-plus/icons-vue'
const props = defineProps(["meta", "vm"]);
const { meta, vm } = props;
const modelName = meta.model;
const model = vm.getModel(modelName);

const rows = computed(() => {
  return model.data.rows;
});

function handleNodeClick(data) {
  vm.execute("nodeClick", {
    model: modelName,
    data
  })
}
</script>
<template>
  <el-tree :data="rows" @node-click="handleNodeClick">
    <template #default="{ node, data }">
      <component :is="Document" style="height:1em;width:1em;margin-right: 3px;" />
      <el-text>
        {{ data.title }}
      </el-text>
    </template>
  </el-tree>
</template>